home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 46
/
Amiga Format CD46 (1999-10-20)(Future Publishing)(GB)[!][issue 1999-12].iso
/
-in_the_mag-
/
reader_requests
/
pdflib
/
makefile.gcc
< prev
next >
Wrap
Makefile
|
1999-09-16
|
9KB
|
359 lines
# ----------------------------------------------------------------------------
# Makefile for PDFlib, Unix version
# (C) Thomas Merz 1997-98
# ----------------------------------------------------------------------------
VERSION = 0.6
# ---------------------- Platform options -------------------------------
# One of the following platform defines must be set:
# -DWIN32 Windows 32 bit
#
# -DDOS MS-DOS
#
# -DMAC Apple Macintosh
#
# -DNeXT NeXTSTEP
#
# -DPOSIX Posix compatible system
# ---------------------- Configuration options -------------------------------
# Add the following defines for configuring several features:
# -DUSE_TIFF use TIFF library for reading TIFF files (requires -DUSE_JPEG)
# -DUSE_TIFF requires -ltiff and -ljpeg
#
# -DUSE_ZLIB use zlib library for decompression (not yet implemented)
# -DUSE_zlib requires -lgz (sometimes -lz)
#
# -DUSE_JPEG use IJG JPEG library for decompressing non-baseline JPEGs
# (currently not implemented)
# This is only required for rare JPEGs, most are handled
# internally in PDFlib. -DUSE_JPEG requires -ljpeg
#
# -DDEBUG makes the PDF output more debug-friendly but may also
# obscure the bugs you're investigating (as predicted by
# Heisenberg's law)
# TIFF and JPEG are not currently supported along with scripting
#DEFINES = -DUSE_TIFF
DEFINES =
EXTRALIBS =
# ------------------- SWIG related stuff ----------------------------------
SWIG = swig
PDFLIB_TCL = BINDINGS/TCL/pdflib.so
SWIGOPT_TCL = -tcl -DTCL -d pdflib_tcl
TCL_OBJS = pdftcl_wrap.o
TCL_INC =
PDFLIB_PYTHON = BINDINGS/PYTHON/pdflib.so
SWIGOPT_PYTHON = -python -d pdflib_python
PYTHON_OBJS = pdfpython_wrap.o
PYTHON_INC = -I/usr/include/python1.4
PDFLIB_PERL = BINDINGS/PERL/pdflib.so
SWIGOPT_PERL = -perl5 -shadow -DPERL5 -d pdflib_perl
PERL_OBJS = pdfperl_wrap.o
PERL_INC = -I/usr/lib/perl5/i586-linux/5.004/CORE
SWIG_OBJS = $(TCL_OBJS) $(PYTHON_OBJS) $(PERL_OBJS)
# ------------------- Make variables for Linux/Gnu Compiler ----------------
# Additional include directories, e.g. for TIFF and ZLIB library headers
INCDIR = -I/usr/local/include $(TCL_INC) $(PYTHON_INC) $(PERL_INC)
CC = gcc
# needed only for swig
PIC_OPT = -fpic # position independent code for shared libraries
SO_OPT = -shared
#CCOPT = -g -c -Wall -pedantic -Wstrict-prototypes $(PIC_OPT) $(INCDIR) -DPOSIX
CCOPT = -g -c $(PIC_OPT) $(INCDIR) -DPOSIX
LD = gcc
LDOPT =
OBJ = o
EXE =
RM = rm -f
MV = mv
AR = ar
AROPTS = rc
RANLIB = ranlib
PDFLIB = libpdf.a
LIBS = $(PDFLIB) -lm
# ------------------- Nothing of interest below ---------------------------
DIRNAME = pdflib-$(VERSION)
TARFILE = pdflib-$(VERSION).tar
.c.$(OBJ) :
$(CC) $(CCOPT) $(DEFINES) $<
SRCS = \
p_basic.c \
p_color.c \
p_draw.c \
p_filter.c \
p_font.c \
p_gif.c \
p_gstate.c \
p_hyper.c \
p_image.c \
p_jpeg.c \
p_text.c \
p_tiff.c \
p_util.c \
afmparse.c \
getopt.c \
hello.c \
imagepdf.c \
pdfclock.c \
pdfgraph.c \
pdfdemo.c \
pdflib.i \
text2pdf.c
OBJS = \
p_basic.$(OBJ) \
p_color.$(OBJ) \
p_draw.$(OBJ) \
p_filter.$(OBJ) \
p_font.$(OBJ) \
p_gif.$(OBJ) \
p_gstate.$(OBJ) \
p_hyper.$(OBJ) \
p_image.$(OBJ) \
p_jpeg.$(OBJ) \
p_text.$(OBJ) \
p_tiff.$(OBJ) \
p_util.$(OBJ) \
afmparse.$(OBJ)
HEADERS = \
afmparse.h \
pdf.h \
p_intern.h \
p_port.h \
ansi_e.h \
macrom_e.h \
pdfdoc_e.h
PROGS = \
text2pdf$(EXE) \
pdfclock$(EXE) \
pdfgraph$(EXE) \
pdfdemo$(EXE) \
hello$(EXE) \
imagepdf$(EXE)
SUPPORT = \
makefile.gcc \
makefile.wat \
README \
CHANGES \
PDFlib-$(VERSION).pdf \
LICENSE
AFMS = \
fonts/Courier.afm \
fonts/Courier-Bold.afm \
fonts/Courier-Oblique.afm \
fonts/Courier-BoldOblique.afm \
fonts/Helvetica.afm \
fonts/Helvetica-Bold.afm \
fonts/Helvetica-Oblique.afm \
fonts/Helvetica-BoldOblique.afm \
fonts/Symbol.afm \
fonts/Times-Roman.afm \
fonts/Times-Bold.afm \
fonts/Times-Italic.afm \
fonts/Times-BoldItalic.afm \
fonts/ZapfDingbats.afm \
fonts/afmlist \
fonts/afmlist.dos
BINDINGS = \
BINDINGS/C/nesrin.jpg \
BINDINGS/C/acro_web.gif \
BINDINGS/C/bible.tif \
BINDINGS/C/graphdata \
BINDINGS/CGI/clock.cgi \
BINDINGS/TCL/hello.tcl \
BINDINGS/TCL/pdfclock.tcl \
BINDINGS/PERL/hello.pl \
BINDINGS/PERL/pdfclock.pl \
BINDINGS/PYTHON/hello.py \
BINDINGS/PYTHON/pdfclock.py
WRAPPERS = \
pdftcl_wrap.c \
pdfperl_wrap.c \
pdfpython_wrap.c \
BINDINGS/PERL/pdflib.pm
SHLIBS = \
$(PDFLIB_TCL) \
$(PDFLIB_PYTHON) \
$(PDFLIB_PERL)
DISTFILES= \
$(SRCS) $(HEADERS) $(SUPPORT) $(AFMS) $(BINDINGS) $(WRAPPERS)
all: $(PDFLIB) $(PROGS) $(SHLIBS)
$(PDFLIB): $(OBJS)
$(RM) $(PDFLIB)
$(AR) $(AROPTS) $(PDFLIB) $(OBJS)
$(RANLIB) $(PDFLIB)
# SWIG related files -------------------------------------------------
# The pdf*_wrap.c files are generated on my machine and redistributed.
# For this reason you don't need to install swig if you want to have
# scripting support in PDFlib!
pdfperl_wrap.c: pdflib.i pdf.h
$(SWIG) $(SWIGOPT_PERL) -o $@ pdflib.i
$(MV) pdflib.pm BINDINGS/PERL
pdftcl_wrap.c: pdflib.i pdf.h
$(SWIG) $(SWIGOPT_TCL) -o $@ pdflib.i
pdfpython_wrap.c: pdflib.i pdf.h
$(SWIG) $(SWIGOPT_PYTHON) -o $@ pdflib.i
# These are the actual shared libraries for scripting support
$(PDFLIB_PERL): $(OBJS) $(PERL_OBJS)
$(RM) $(PDFLIB_PERL)
$(CC) $(SO_OPT) $(OBJS) $(PERL_OBJS) -o $(PDFLIB_PERL)
$(PDFLIB_TCL): $(OBJS) $(TCL_OBJS)
$(RM) $(PDFLIB_TCL)
$(CC) $(SO_OPT) $(OBJS) $(TCL_OBJS) -o $(PDFLIB_TCL)
$(PDFLIB_PYTHON): $(OBJS) $(PYTHON_OBJS)
$(RM) $(PDFLIB_PYTHON)
$(CC) $(SO_OPT) $(OBJS) $(PYTHON_OBJS) -o $(PDFLIB_PYTHON)
# end SWIG support -------------------------------------------------
TESTFILES = \
BINDINGS/C/clock.pdf \
BINDINGS/C/readme.pdf \
BINDINGS/C/images.pdf \
BINDINGS/C/hello.pdf \
BINDINGS/C/demo.pdf \
BINDINGS/PERL/hello_perl.pdf \
BINDINGS/PERL/pdfclock_perl.pdf \
BINDINGS/TCL/hello_tcl.pdf \
BINDINGS/TCL/pdfclock_tcl.pdf \
BINDINGS/PYTHON/hello_python.pdf \
BINDINGS/PYTHON/pdfclock_python.pdf
# library clients
text2pdf$(EXE): text2pdf.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
pdfgraph$(EXE): pdfgraph.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
pdfdemo$(EXE): pdfdemo.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
pdfclock$(EXE): pdfclock.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
hello$(EXE): hello.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
imagepdf$(EXE): imagepdf.$(OBJ) $(PDFLIB) pdf.h p_port.h
$(LD) $(LDOPT) -o $@ $< $(LIBS) $(EXTRALIBS)
dist:
$(RM) -f $(TARFILE).gz; \
ln -s . $(DIRNAME); \
(for i in $(DISTFILES); do \
echo $$i; \
done) | sed "s;.*;$(DIRNAME)/&;" >distfiles; \
tar cvf $(TARFILE) `cat distfiles`; \
gzip $(TARFILE); \
rm -f $(DIRNAME) distfiles;
clean:
$(RM) *.$(OBJ) $(PROGS) $(PDFLIB) $(TESTFILES) $(SWIG_OBJS) $(SHLIBS)
# Don't use swigclean because it deletes files which cannot be
# easily reconstructed (except on my machine)!
swigclean:
$(RM) pdflib_perl.doc pdflib_python.doc pdflib_tcl.doc
$(RM) $(SHLIBS)
$(RM) $(WRAPPERS)
BINDINGS/C/clock.pdf: pdfclock$(EXE)
./pdfclock -o BINDINGS/C/clock.pdf
BINDINGS/C/readme.pdf: text2pdf$(EXE)
./text2pdf -o BINDINGS/C/readme.pdf README
BINDINGS/C/images.pdf: imagepdf$(EXE)
./imagepdf -o BINDINGS/C/images.pdf BINDINGS/C/bible.tif BINDINGS/C/acro_web.gif BINDINGS/C/nesrin.jpg
BINDINGS/C/demo.pdf: pdfdemo$(EXE)
./pdfdemo BINDINGS/C/demo.pdf
BINDINGS/C/hello.pdf: hello$(EXE)
./hello BINDINGS/C/hello.pdf
BINDINGS/PERL/hello_perl.pdf:
(cd BINDINGS/PERL; ./hello.pl)
BINDINGS/PERL/pdfclock_perl.pdf:
(cd BINDINGS/PERL; ./pdfclock.pl)
BINDINGS/TCL/hello_tcl.pdf:
(cd BINDINGS/TCL; ./hello.tcl)
BINDINGS/TCL/pdfclock_tcl.pdf:
(cd BINDINGS/TCL; ./pdfclock.tcl)
BINDINGS/PYTHON/hello_python.pdf:
(cd BINDINGS/PYTHON; ./hello.py)
BINDINGS/PYTHON/pdfclock_python.pdf:
(cd BINDINGS/PYTHON; ./pdfclock.py)
test: $(PROGS) $(TESTFILES)
# PDFlib library modules
afmparse.$(OBJ): afmparse.c afmparse.h
p_hyper.$(OBJ): p_hyper.c pdf.h p_intern.h pdfdoc_e.h
p_color.$(OBJ): p_color.c pdf.h p_intern.h
p_basic.$(OBJ): p_basic.c pdf.h p_intern.h
p_draw.$(OBJ): p_draw.c pdf.h p_intern.h
p_filter.$(OBJ): p_filter.c pdf.h p_intern.h
p_font.$(OBJ): p_font.c pdf.h p_intern.h ansi_e.h macrom_e.h
p_gif.$(OBJ): p_gif.c pdf.h p_intern.h
p_gstate.$(OBJ): p_gstate.c pdf.h p_intern.h
p_image.$(OBJ): p_image.c pdf.h p_intern.h
p_jpeg.$(OBJ): p_jpeg.c pdf.h p_intern.h
p_text.$(OBJ): p_text.c pdf.h p_intern.h
p_tiff.$(OBJ): p_tiff.c pdf.h p_intern.h
p_util.$(OBJ): p_util.c pdf.h p_intern.h